
#include "Piece.h"

/**
 * The ChessPlayer class provides an interface for a ChessController implementation to interact
 * with the player through, regardless of whether the player is a human or a computer.
 */

Piece::Piece (bool clrWhite) {
   white = clrWhite;
}

Piece::~Piece() {}


bool Piece::IsWhite() const {
   return white;
}

std::ostream& Piece::Save(std::ostream & os, int row, int col) const {
   std::string color = IsWhite() ? "white" : "black";
   os << "<piece type=\"" << GetType() <<"\" color=\""<< color <<
      "\" row=\"" << row << "\" column=\"" << col << "\" />" << std::endl;
   return os;
}
